package com.deer.wms.ware.task.dao;

import com.deer.wms.project.root.mapper.SuperMapper;
import com.deer.wms.ware.task.model.Return.SoLogItemDto;
import com.deer.wms.ware.task.model.SO.SoDayList;
import com.deer.wms.ware.task.model.SO.SoDetail;
import com.deer.wms.ware.task.model.SO.SoDetailCriteria;
import com.deer.wms.ware.task.model.SO.SoDetailDto;
import com.deer.wms.ware.task.model.SO.contrast.ContrastVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface SoDetailMapper extends SuperMapper<SoDetail> {

    List<SoDetailDto> findList(SoDetailCriteria criteria);

    List<SoDetail>findByBillNo(@Param("billNo") String billNo);

    /**
     * 查询所有未完全分配的SO明细
     * @return List<SoDetailDto>
     */
    List<SoDetailDto> findUndistributedSoDetail( @Param("soType") Integer soType);

    List<SoDetailDto> findDetailsByWaveId(@Param("wareId")Integer wareId,@Param("waveId")Integer waveId);

    List<SoDetail> findByMasterId(@Param("soId") Integer soId);

    List<SoDayList> findDayList(SoDetailCriteria criteria);

    List<SoDetailDto> findBaoKuanByItemCode(@Param("itemCode") String itemCode, @Param("wareId") Integer wareId, @Param("orgId") Integer orgId);

    List<SoLogItemDto> findLogItemsByBillNos(@Param("list") List<String> billNos);


    /**
     * 生产任务单号查询
     *
     * @param billNos@return
     */
    List<SoDetail> findByOrderNo(List<String> billNos);

    List<SoDetail> beBeing(ContrastVo contrastVo);


    String findbyCellCode(String asnDetailNo);

    SoDetail findOne(@Param("waveCode") String waveCode,@Param("itemCode") String itemCode, @Param("quantity") Double quantity);

    Set<SoDetail> soList(@Param("waveCode") String waveCode, @Param("itemCode") String itemCode);
}
